//
//  OrderDetailView.m
//  HAODE
//
//  Created by panquanReabam.com on 16/5/26.
//  Copyright © 2016年 reabam.com. All rights reserved.
//

#import "CommonDetailView.h"
#import "GoodsView.h"

@interface CommonDetailView()
@property(nonatomic,strong)UIView*orderView;

@property(nonatomic,strong)UIView*noView;
@property(nonatomic,strong)UIView*memberView;
@property(nonatomic,strong)UILabel*stateLabel;
@property(nonatomic,strong)UILabel*stateLabel1;
@property(nonatomic,strong)UILabel*stateLabel2;
@property(nonatomic,strong)UILabel*orderNoLabel;
@property(nonatomic,strong)UILabel*source;
@property(nonatomic,strong)UILabel*sourceLabel;
@property(nonatomic,strong)UILabel*orderDate;
@property(nonatomic,strong)UILabel*orderDateLabel;
@property(nonatomic,strong)UILabel*memberName;
@property(nonatomic,strong)UILabel*memberNameLabel;
@property(nonatomic,strong)UILabel*address;
@property(nonatomic,strong)UILabel*addressLabel;
@property(nonatomic,strong)UIImageView*sexImage;
@property(nonatomic,strong)UILabel*consignee;
@property(nonatomic,strong)UILabel*consigneeLabel;
@property(nonatomic,strong)UILabel*phone;
@property(nonatomic,strong)UILabel*phoneLabel;
@property(nonatomic,strong)UILabel*levelLabel;
@property(nonatomic,strong)UIView*orderItemView;
@end
@implementation CommonDetailView
{

GoodsView*goodsView;

NSMutableArray*orderItemArray;
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
    
        
    }
    return self;
}
#pragma mark InitUI
- (void)initUI
{
    self .backgroundColor = [UIColor whiteColor];
    _orderView=[[UIView alloc]init];
    _orderView.backgroundColor=[UIColor whiteColor];
    [self addSubview:_orderView];
    
    _noView=[[UIView alloc]init];
    _noView.backgroundColor=[UIColor whiteColor];
    [_orderView addSubview:_noView];
   
    _memberView=[[UIView alloc]init];
    _memberView.backgroundColor=[UIColor whiteColor];
    [_orderView addSubview:_memberView];
    
    _orderNoLabel=[[UILabel alloc]init];
    _orderNoLabel.textColor=[UIColor blackColor];
    _orderNoLabel.font=[UIFont systemFontOfSize:17];
    [self addSubview:_orderNoLabel];
    
    
    _stateLabel=[[UILabel alloc]init];
    _stateLabel.textColor=luseColor;
    _stateLabel.font=[UIFont systemFontOfSize:Statusfot];
    [self addSubview:_stateLabel];
    
    
    _stateLabel1=[[UILabel alloc]init];
    _stateLabel1.textColor=luseColor;
    _stateLabel1.font=[UIFont systemFontOfSize:Statusfot];
    [self addSubview:_stateLabel1];

    _stateLabel2=[[UILabel alloc]init];
    _stateLabel2.textColor=luseColor;
    _stateLabel2.font=[UIFont systemFontOfSize:Statusfot];
    [self addSubview:_stateLabel2];

    
    _source=[[UILabel alloc]init];
    _source.text=[NSString stringWithFormat:@"来源"];
    _source.textColor=zhonghuiColor;
    _source.font=[UIFont systemFontOfSize:contenfot];
    [self addSubview:_source];
    
    _sourceLabel=[[UILabel alloc]init];
    _sourceLabel.textColor=shenhuiColor;
    _sourceLabel.font=[UIFont systemFontOfSize:contenfot];
    [self addSubview:_sourceLabel];
    
    
    _orderDate=[[UILabel alloc]init];
    _orderDate.textColor=shenhuiColor;
    _orderDate.font=[UIFont systemFontOfSize:contenfot];
    [self addSubview:_orderDate];
    
    
    _memberName=[[UILabel alloc]init];
    _memberName.textColor=qianheiColor;
    _memberName.font=[UIFont systemFontOfSize:16];
    [self addSubview:_memberName];

    _sexImage=[[UIImageView alloc]init];
    [self addSubview:_sexImage];

    _levelLabel=[[UILabel alloc]init];
    _levelLabel.textColor=zhonghuiColor;
    _levelLabel.text=@"等级";
    _levelLabel.font=[UIFont systemFontOfSize:contenfot];
    [self addSubview:_levelLabel];

    _consignee=[[UILabel alloc]init];
    _consignee.textColor=zhonghuiColor;
    _consignee.text=@"收货人";
    _consignee.font=[UIFont systemFontOfSize:contenfot];
    [self addSubview:_consignee];

    _consigneeLabel=[[UILabel alloc]init];
    _consigneeLabel.textColor=shenhuiColor;
    _consigneeLabel.font=[UIFont systemFontOfSize:contenfot];
    [self addSubview:_consigneeLabel];

    _phone=[[UILabel alloc]init];
    _phone.textColor=zhonghuiColor;
     _phone.text=@"电话";
    _phone.font=[UIFont systemFontOfSize:contenfot];
    [self addSubview:_phone];
    
    _phoneLabel=[[UILabel alloc]init];
    _phoneLabel.textColor=shenhuiColor;
    _phoneLabel.font=[UIFont systemFontOfSize:contenfot];
    [self addSubview:_phoneLabel];
    
    _address=[[UILabel alloc]init];
    _address.textColor=zhonghuiColor;
    _address.text=@"收货地址";
    _address.font=[UIFont systemFontOfSize:contenfot];
    [self addSubview:_address];
    
    _addressLabel=[[UILabel alloc]init];
    _addressLabel.textColor=shenhuiColor;
    _addressLabel.font=[UIFont systemFontOfSize:contenfot];
    [self addSubview:_addressLabel];
    
    _orderItemView=[[UIView alloc]init];
    _orderItemView.backgroundColor=[UIColor whiteColor];
    [self addSubview:_orderItemView];
    
    UILabel *line=[[UILabel alloc] initWithFrame:CGRectMake(0,0, ScreenWidth, 0.35)];
    line.backgroundColor=qianhuiColor;
    [_orderItemView addSubview:line];
    
    UILabel*shangpingxinxi=[[UILabel alloc]initWithFrame:CGRectMake(15, 0, 80, 44)];
    shangpingxinxi.text=@"商品信息";
    shangpingxinxi.textColor=[UIColor blackColor];
    shangpingxinxi.font=[UIFont systemFontOfSize:15];
    [_orderItemView addSubview:shangpingxinxi];
    UILabel *lineLabel=[[UILabel alloc] initWithFrame:CGRectMake(15, 44-0.35, ScreenWidth-30, 0.35)];
    lineLabel.backgroundColor=qianhuiColor;
    [_orderItemView addSubview:lineLabel];
    UIView*view=[[UIView alloc]initWithFrame:CGRectMake(0, 70, ScreenWidth, 10)];
    view.backgroundColor=zuiqianhuiColor;
    view.layer.borderColor = qianhuiColor.CGColor;
    [view.layer setBorderWidth:0.35];   //边
    [self addSubview:view];
    UIView*view1=[[UIView alloc]initWithFrame:CGRectMake(0, 250/2+80, ScreenWidth, 10)];
    view1.backgroundColor=zuiqianhuiColor;
    view1.layer.borderColor = qianhuiColor.CGColor;
    [view1.layer setBorderWidth:0.35];   //边
    [self addSubview:view1];
    _heightView=[[UIView alloc]init];
    _heightView.backgroundColor=qianhuiColor;
    [self addSubview:_heightView];
}


-(void)setModel:(OrderDetailModel *)model{
    [self initUI];
    [self setViewAutoLayout];
    self.orderNoLabel.text=[NSString stringWithFormat:@"%@", [[model.dict objectForKey:@"order"] objectForKey:@"orderNo"]];
    self.stateLabel.text=[NSString stringWithFormat:@"%@",   [[model.dict objectForKey:@"order"] objectForKey:@"orderStatusName"]];
    self.stateLabel1.text=[NSString stringWithFormat:@"%@",  [[model.dict objectForKey:@"order"] objectForKey:@"deliveryStatusName"]];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",  [[model.dict objectForKey:@"order"] objectForKey:@"source"]];
    self.orderDate.text=[NSString stringWithFormat:@"%@",    [[model.dict objectForKey:@"order"] objectForKey:@"orderDate"]];
    self.memberName.text=[NSString stringWithFormat:@"%@ (%@)",[[model.dict objectForKey:@"member"] objectForKey:@"memberName"], [[model.dict objectForKey:@"member"] objectForKey:@"phone"]];
    if (![[[model.dict objectForKey:@"member"] objectForKey:@"sex"] isEqual:[NSNull null]]) {
        
        if ([[[model.dict objectForKey:@"member"] objectForKey:@"sex"]isEqualToString:@"男"]) {
          self.sexImage.image=[UIImage imageNamed:@"nan"];
            
            
        }else{
            self.sexImage.image=[UIImage imageNamed:@"nv"];
        }
        }else{
        self.sexImage.image=[UIImage imageNamed:@"nv"];
        
        
    }

    self.consigneeLabel.text=[NSString stringWithFormat:@"%@", [[model.dict objectForKey:@"send"] objectForKey:@"consignee"]];
    self.phoneLabel.text=[NSString stringWithFormat:@"%@",   [[model.dict objectForKey:@"send"] objectForKey:@"phone"]];
    self.addressLabel.text=[NSString stringWithFormat:@"%@",  [[model.dict objectForKey:@"send"] objectForKey:@"address"]];

    orderItemArray=[model.dict objectForKey:@"orderItem"];
    if (orderItemArray.count>0) {
    for (int i = 0; i<orderItemArray.count; i++) {
    
                goodsView = [[GoodsView alloc]initWithFrame:CGRectMake(0, 250/2+60+80+(120*i), ScreenWidth, 120)];
                goodsView.backgroundColor=[UIColor whiteColor];
                [goodsView.headImageFull setImageWithURL:[[orderItemArray objectAtIndex:i] objectForKey:@"headImageFull"] placeholderImage:[UIImage imageNamed:@""]];
                [goodsView.headImageFull.layer setCornerRadius:5.0];
                [goodsView.headImageFull.layer setBorderWidth:0.3];
                [goodsView.headImageFull.layer setMasksToBounds:YES];
                CGColorSpaceRef colorSpace2 = CGColorSpaceCreateDeviceRGB();
                CGColorRef colorref2 = CGColorCreate(colorSpace2,(CGFloat[]){ 0, 0, 0, 0.3 });
                [goodsView.headImageFull.layer setBorderColor:colorref2];//边框颜色
                goodsView.itemName.text=[NSString stringWithFormat:@"%@%@",[[orderItemArray objectAtIndex:i] objectForKey:@"itemCode"],[[orderItemArray objectAtIndex:i] objectForKey:@"itemName"]];
                goodsView.quantity.text=[NSString stringWithFormat:@"数量 %@",[[orderItemArray objectAtIndex:i] objectForKey:@"quantity"]];
    
                NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
                [numberFormatter setPositiveFormat:@"###,##0.00;"];
                NSString *formattedNumberString = [numberFormatter stringFromNumber:[[orderItemArray objectAtIndex:i] objectForKey:@"dealPrice"]];
                goodsView.dealPrice.text=[NSString stringWithFormat:@"¥ %@",formattedNumberString];
                goodsView.dealPrice.textColor=[UIColor blackColor];
                goodsView.dealPrice.font=[UIFont systemFontOfSize:16];
                NSMutableAttributedString *AttributedStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"¥ %@" ,formattedNumberString]];
    
                [AttributedStr addAttribute:NSFontAttributeName
    
                                      value:[UIFont systemFontOfSize:14]
    
                                      range:NSMakeRange(0, 1)];
    
                [AttributedStr addAttribute:NSForegroundColorAttributeName
    
                                      value:shenhuiColor
    
                                      range:NSMakeRange(0, 1)];
                goodsView.dealPrice.attributedText = AttributedStr;
                goodsView.itemType.text=[NSString stringWithFormat:@"%@",[[orderItemArray objectAtIndex:i] objectForKey:@"specName"]];
    
                UILabel *lineLabel1=[[UILabel alloc] initWithFrame:CGRectMake(15, 120-0.35, ScreenWidth-30, 0.35)];
                lineLabel1.backgroundColor=qianhuiColor;
                [goodsView addSubview:lineLabel1];
                [self addSubview:goodsView];
            }
            _heightView.frame=CGRectMake(0, goodsView.bottom, ScreenWidth, 0.15);}
}

-(void)setServiceModel:(ServiceDetailModel *)ServiceModel{
    [self initUI];
    [self setViewAutoLayout];
    self.orderNoLabel.text=[NSString stringWithFormat:@"%@", [[ServiceModel.dict objectForKey:@"service"] objectForKey:@"serviceNo"]];
    self.stateLabel.text=[NSString stringWithFormat:@"%@",   [[ServiceModel.dict objectForKey:@"service"] objectForKey:@"serviceStatusName"]];
    self.stateLabel1.text=[NSString stringWithFormat:@"%@",  [[ServiceModel.dict objectForKey:@"service"] objectForKey:@"serviceTypeName"]];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",  [[ServiceModel.dict objectForKey:@"service"] objectForKey:@"source"]];
    self.orderDate.text=[NSString stringWithFormat:@"%@",    [[ServiceModel.dict objectForKey:@"service"] objectForKey:@"serviceDate"]];
    self.memberName.text=[NSString stringWithFormat:@"%@ (%@)",[[ServiceModel.dict objectForKey:@"member"] objectForKey:@"memberName"], [[ServiceModel.dict objectForKey:@"member"] objectForKey:@"phone"]];
    if (![[[ServiceModel.dict objectForKey:@"member"] objectForKey:@"sex"] isEqual:[NSNull null]]) {
        
        if ([[[ServiceModel.dict objectForKey:@"member"] objectForKey:@"sex"]isEqualToString:@"男"]) {
            self.sexImage.image=[UIImage imageNamed:@"nan"];
            
            
        }else{
            self.sexImage.image=[UIImage imageNamed:@"nv"];
        }
    }else{
        self.sexImage.image=[UIImage imageNamed:@"nv"];
        
        
    }
    
    self.consigneeLabel.text=[NSString stringWithFormat:@"%@", [[ServiceModel.dict objectForKey:@"send"] objectForKey:@"consignee"]];
    self.phoneLabel.text=[NSString stringWithFormat:@"%@",   [[ServiceModel.dict objectForKey:@"send"] objectForKey:@"phone"]];
    self.addressLabel.text=[NSString stringWithFormat:@"%@",  [[ServiceModel.dict objectForKey:@"send"] objectForKey:@"address"]];
    
    orderItemArray=[ServiceModel.dict objectForKey:@"orderItem"];
    if (orderItemArray.count>0) {
        for (int i = 0; i<orderItemArray.count; i++) {
            
            goodsView = [[GoodsView alloc]initWithFrame:CGRectMake(0, 250/2+60+80+(120*i), ScreenWidth, 120)];
            goodsView.backgroundColor=[UIColor whiteColor];
            [goodsView.headImageFull setImageWithURL:[[orderItemArray objectAtIndex:i] objectForKey:@"headImageFull"] placeholderImage:[UIImage imageNamed:@""]];
            [goodsView.headImageFull.layer setCornerRadius:5.0];
            [goodsView.headImageFull.layer setBorderWidth:0.3];
            [goodsView.headImageFull.layer setMasksToBounds:YES];
            CGColorSpaceRef colorSpace2 = CGColorSpaceCreateDeviceRGB();
            CGColorRef colorref2 = CGColorCreate(colorSpace2,(CGFloat[]){ 0, 0, 0, 0.3 });
            [goodsView.headImageFull.layer setBorderColor:colorref2];//边框颜色
            goodsView.itemName.text=[NSString stringWithFormat:@"%@%@",[[orderItemArray objectAtIndex:i] objectForKey:@"itemCode"],[[orderItemArray objectAtIndex:i] objectForKey:@"itemName"]];
            goodsView.quantity.text=[NSString stringWithFormat:@"数量 %@",[[orderItemArray objectAtIndex:i] objectForKey:@"quantity"]];
            
            NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
            [numberFormatter setPositiveFormat:@"###,##0.00;"];
            NSString *formattedNumberString = [numberFormatter stringFromNumber:[[orderItemArray objectAtIndex:i] objectForKey:@"dealPrice"]];
            goodsView.dealPrice.text=[NSString stringWithFormat:@"¥ %@",formattedNumberString];
            goodsView.dealPrice.textColor=[UIColor blackColor];
            goodsView.dealPrice.font=[UIFont systemFontOfSize:16];
            NSMutableAttributedString *AttributedStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"¥ %@" ,formattedNumberString]];
            
            [AttributedStr addAttribute:NSFontAttributeName
             
                                  value:[UIFont systemFontOfSize:14]
             
                                  range:NSMakeRange(0, 1)];
            
            [AttributedStr addAttribute:NSForegroundColorAttributeName
             
                                  value:shenhuiColor
             
                                  range:NSMakeRange(0, 1)];
            goodsView.dealPrice.attributedText = AttributedStr;
            goodsView.itemType.text=[NSString stringWithFormat:@"%@",[[orderItemArray objectAtIndex:i] objectForKey:@"specName"]];
            
            UILabel *lineLabel1=[[UILabel alloc] initWithFrame:CGRectMake(15, 120-0.35, ScreenWidth-30, 0.35)];
            lineLabel1.backgroundColor=qianhuiColor;
            [goodsView addSubview:lineLabel1];
            [self addSubview:goodsView];
        }
        _heightView.frame=CGRectMake(0, goodsView.bottom, ScreenWidth, 10);
        _heightView.backgroundColor=zuiqianhuiColor;
        _heightView.layer.borderColor = qianhuiColor.CGColor;
        [_heightView.layer setBorderWidth:0.25];   //边
        
    }
}
-(void)setDeliveryModel:(DeliveryDetailModel *)DeliveryModel{
    [self initUI];
    [self setViewAutoLayout];
    self.orderNoLabel.text=[NSString stringWithFormat:@"%@", [[DeliveryModel.dict objectForKey:@"delivery"] objectForKey:@"deliveryNo"]];
    
    self.stateLabel.text=[NSString stringWithFormat:@"%@",   @"已配送"];
//    self.stateLabel1.text=[NSString stringWithFormat:@"%@",  [[DeliveryModel.dict objectForKey:@"delivery"] objectForKey:@"deliveryTypeName"]];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",  [[DeliveryModel.dict objectForKey:@"delivery"] objectForKey:@"source"]];
    self.orderDate.text=[NSString stringWithFormat:@"%@",    [[DeliveryModel.dict objectForKey:@"delivery"] objectForKey:@"deliveryDate"]];
    self.memberName.text=[NSString stringWithFormat:@"%@ (%@)",[[DeliveryModel.dict objectForKey:@"member"] objectForKey:@"memberName"], [[DeliveryModel.dict objectForKey:@"member"] objectForKey:@"phone"]];
    if (![[[DeliveryModel.dict objectForKey:@"member"] objectForKey:@"sex"] isEqual:[NSNull null]]) {
        
        if ([[[DeliveryModel.dict objectForKey:@"member"] objectForKey:@"sex"]isEqualToString:@"男"]) {
            self.sexImage.image=[UIImage imageNamed:@"nan"];
            
            
        }else{
            self.sexImage.image=[UIImage imageNamed:@"nv"];
        }
    }else{
        self.sexImage.image=[UIImage imageNamed:@"nv"];
        
        
    }
    
    self.consigneeLabel.text=[NSString stringWithFormat:@"%@", [[DeliveryModel.dict objectForKey:@"send"] objectForKey:@"consignee"]];
    self.phoneLabel.text=[NSString stringWithFormat:@"%@",   [[DeliveryModel.dict objectForKey:@"send"] objectForKey:@"phone"]];
    self.addressLabel.text=[NSString stringWithFormat:@"%@",  [[DeliveryModel.dict objectForKey:@"send"] objectForKey:@"address"]];
    
    orderItemArray=[DeliveryModel.dict objectForKey:@"orderItem"];
    if (orderItemArray.count>0) {
        for (int i = 0; i<orderItemArray.count; i++) {
            
            goodsView = [[GoodsView alloc]initWithFrame:CGRectMake(0, 250/2+60+80+(120*i), ScreenWidth, 120)];
            goodsView.backgroundColor=[UIColor whiteColor];
            [goodsView.headImageFull setImageWithURL:[[orderItemArray objectAtIndex:i] objectForKey:@"headImageFull"] placeholderImage:[UIImage imageNamed:@""]];
            [goodsView.headImageFull.layer setCornerRadius:5.0];
            [goodsView.headImageFull.layer setBorderWidth:0.3];
            [goodsView.headImageFull.layer setMasksToBounds:YES];
            CGColorSpaceRef colorSpace2 = CGColorSpaceCreateDeviceRGB();
            CGColorRef colorref2 = CGColorCreate(colorSpace2,(CGFloat[]){ 0, 0, 0, 0.3 });
            [goodsView.headImageFull.layer setBorderColor:colorref2];//边框颜色
            goodsView.itemName.text=[NSString stringWithFormat:@"%@%@",[[orderItemArray objectAtIndex:i] objectForKey:@"itemCode"],[[orderItemArray objectAtIndex:i] objectForKey:@"itemName"]];
            goodsView.quantity.text=[NSString stringWithFormat:@"数量 %@",[[orderItemArray objectAtIndex:i] objectForKey:@"quantity"]];
            
            NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
            [numberFormatter setPositiveFormat:@"###,##0.00;"];
            NSString *formattedNumberString = [numberFormatter stringFromNumber:[[orderItemArray objectAtIndex:i] objectForKey:@"dealPrice"]];
            goodsView.dealPrice.text=[NSString stringWithFormat:@"¥ %@",formattedNumberString];
            goodsView.dealPrice.textColor=[UIColor blackColor];
            goodsView.dealPrice.font=[UIFont systemFontOfSize:16];
            NSMutableAttributedString *AttributedStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"¥ %@" ,formattedNumberString]];
            
            [AttributedStr addAttribute:NSFontAttributeName
             
                                  value:[UIFont systemFontOfSize:14]
             
                                  range:NSMakeRange(0, 1)];
            
            [AttributedStr addAttribute:NSForegroundColorAttributeName
             
                                  value:shenhuiColor
             
                                  range:NSMakeRange(0, 1)];
            goodsView.dealPrice.attributedText = AttributedStr;
            goodsView.itemType.text=[NSString stringWithFormat:@"%@",[[orderItemArray objectAtIndex:i] objectForKey:@"specName"]];
            
            UILabel *lineLabel1=[[UILabel alloc] initWithFrame:CGRectMake(15, 120-0.35, ScreenWidth-30, 0.35)];
            lineLabel1.backgroundColor=qianhuiColor;
            [goodsView addSubview:lineLabel1];
            [self addSubview:goodsView];
        }
        _heightView.frame=CGRectMake(0, goodsView.bottom, ScreenWidth, 10);
        _heightView.backgroundColor=zuiqianhuiColor;
        _heightView.layer.borderColor = qianhuiColor.CGColor;
        [_heightView.layer setBorderWidth:0.25];   //边
        
    }
}


-(void)setDeliveryConfirmModel:(DeliveryConfirmMemberModel *)DeliveryConfirmModel{

    [self initUI];
    [self setViewAutoLayout];
    self.orderNoLabel.text=[NSString stringWithFormat:@"%@", [[DeliveryConfirmModel.dict objectForKey:@"order"] objectForKey:@"orderNo"]];
    self.stateLabel.text=[NSString stringWithFormat:@"%@",   [[DeliveryConfirmModel.dict objectForKey:@"order"] objectForKey:@"orderStatusName"]];
    self.stateLabel1.text=[NSString stringWithFormat:@"%@",  [[DeliveryConfirmModel.dict objectForKey:@"order"] objectForKey:@"deliveryStatusName"]];
    self.sourceLabel.text=[NSString stringWithFormat:@"%@",  [[DeliveryConfirmModel.dict objectForKey:@"order"] objectForKey:@"source"]];
    self.orderDate.text=[NSString stringWithFormat:@"%@",    [[DeliveryConfirmModel.dict objectForKey:@"order"] objectForKey:@"orderDate"]];
    self.memberName.text=[NSString stringWithFormat:@"%@ (%@)",[[DeliveryConfirmModel.dict objectForKey:@"member"] objectForKey:@"memberName"], [[DeliveryConfirmModel.dict objectForKey:@"member"] objectForKey:@"phone"]];
    if (![[[DeliveryConfirmModel.dict objectForKey:@"member"] objectForKey:@"sex"] isEqual:[NSNull null]]) {
        
        if ([[[DeliveryConfirmModel.dict objectForKey:@"member"] objectForKey:@"sex"]isEqualToString:@"男"]) {
            self.sexImage.image=[UIImage imageNamed:@"nan"];
            
            
        }else{
            self.sexImage.image=[UIImage imageNamed:@"nv"];
        }
    }else{
        self.sexImage.image=[UIImage imageNamed:@"nv"];
        
        
    }
    
    self.consigneeLabel.text=[NSString stringWithFormat:@"%@", [[DeliveryConfirmModel.dict objectForKey:@"send"] objectForKey:@"consignee"]];
    self.phoneLabel.text=[NSString stringWithFormat:@"%@",   [[DeliveryConfirmModel.dict objectForKey:@"send"] objectForKey:@"phone"]];
    self.addressLabel.text=[NSString stringWithFormat:@"%@",  [[DeliveryConfirmModel.dict objectForKey:@"send"] objectForKey:@"address"]];
    

//        _heightView.frame=CGRectMake(0, goodsView.bottom, ScreenWidth, 0.15);



}


-(void)setViewAutoLayout
{
    [self.orderView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(0) ;
        make.height.equalTo(@300);
        make.top.equalTo(self.mas_top).with.offset(0);
    }];
    [self.orderNoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.height.equalTo(@17);
        make.top.equalTo(self.mas_top).with.offset(15);
    }];
    [self.noView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(0) ;
        make.height.equalTo(@70);
        make.top.equalTo(self.mas_top).with.offset(0);
    }];
    [self.memberView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(0) ;
        make.height.equalTo(@125);
        make.top.equalTo(self.noView.mas_bottom).with.offset(10);
    }];
    
    
    [self.stateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.orderNoLabel.mas_right).with.offset(15);
        make.height.equalTo(@13);
        
        make.centerY.equalTo(self.orderNoLabel.mas_centerY) ;
    }];
    [self.stateLabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.stateLabel.mas_right).with.offset(5);
        make.height.equalTo(@13);
        
         make.centerY.equalTo(self.orderNoLabel.mas_centerY) ;
    }];
    [self.stateLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.stateLabel1.mas_right).with.offset(5);
        make.height.equalTo(@13);
        
          make.centerY.equalTo(self.orderNoLabel.mas_centerY) ;
    }];
    
    [self.source mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.height.equalTo(@14);
        make.top.equalTo(self.orderNoLabel.mas_bottom).with.offset(10);
    }];

    [self.sourceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.source.mas_right).with.offset(3);
        make.height.equalTo(@14);
        
        make.top.equalTo(self.orderNoLabel.mas_bottom).with.offset(10);
    }];

    
    [self.orderDate mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.sourceLabel.mas_right).with.offset(15) ;
        make.height.equalTo(@14);
        make.centerY.equalTo(self.source.mas_centerY) ;
    }];

    [self.memberName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.height.equalTo(@50);
        make.top.equalTo(self.noView.mas_bottom).with.offset(10);
        
    }];
    [self.sexImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.memberName.mas_right).with.offset(15);
        make.height.equalTo(@20);
        make.width.equalTo(@20);
        make.centerY.equalTo(self.memberName.mas_centerY) ;
    }];
    
    [self.levelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.sexImage.mas_right).with.offset(10);
        make.height.equalTo(@14);
        make.centerY.equalTo(self.memberName.mas_centerY) ;
        
    }];
    
    
    [self.consignee mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.height.equalTo(@14);
        make.top.equalTo(self.memberName.mas_bottom).with.offset(15);
    }];
    
    [self.consigneeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.consignee.mas_right).with.offset(3);
        make.height.equalTo(@14);
        make.centerY.equalTo(self.consignee.mas_centerY) ;
        
    }];

    [self.phone mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.consigneeLabel.mas_right).with.offset(15) ;
        make.height.equalTo(@14);
        make.centerY.equalTo(self.consignee.mas_centerY) ;
        
    }];
    
    [self.phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.phone.mas_right).with.offset(3);
        make.height.equalTo(@14);
        
        make.centerY.equalTo(self.consignee.mas_centerY) ;
        
    }];
    [self.address mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(15) ;
        make.height.equalTo(@14);
        make.top.equalTo(self.consignee.mas_bottom).with.offset(5);
    }];
    
    [self.addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.address.mas_right).with.offset(3);
        make.height.equalTo(@14);
        make.centerY.equalTo(self.address.mas_centerY) ;
        
    }];
    [self.orderItemView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(0);
        make.height.equalTo(@50);
        make.top.equalTo(self.memberView.mas_bottom).with.offset(10);
        
    }];
    
    
}

@end
